#!/usr/bin/perl

$senNum = 1;
while($line=<STDIN>) {
	chomp($line);
	@words = split(/\s+/,$line);
	my(%aligns) = ();
	foreach $word (@words) {
		($tgt,$src) = split(/-/,$word);
		$aligns{"$src\.$tgt"} = 1;
	}
	foreach $key (sort {$a<=>$b} keys %aligns) {
		$key=~s/\./\t/g;
		print $senNum."\t".$key."\n";
	}
	$senNum++;
}
